﻿@model EM.OA.Portal.Models.DictionaryModels
@{
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}

<script type="text/javascript" src="~/Scripts/page/SystemSetting/Dictionary.js"></script>

@*list*@
<div>
    <table id="list"></table>
</div>
@*Detail*@
<div id="dlg" class="easyui-dialog" style="width: 400px; height: 380px; padding: 10px 20px"
    closed="true" buttons="#dlg-buttons" modal="true" resizable="true">
    <form id="fm" method="post">
        @Html.HiddenFor(m => m.DictionaryID)
        <table>
            <tr>
                <td>@Html.LabelFor(m => m.DictionaryName)</td>
                <td>@Html.TextBoxFor(m => m.DictionaryName, new { @class = "easyui-validatebox", @required = "true" })</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.DictionaryCode)</td>
                <td>
                    @Html.TextBoxFor(m => m.DictionaryCode, new { @class = "easyui-validatebox", @required = "true" })
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.DictionaryParentID)</td>
                <td>
                    <input type="hidden" id="DictionaryParentID" name="DictionaryParentID" />
                    <input id="comb_DictionaryParentName" class="easyui-combotree"
                        data-options="url:'/Dictionary/GetTreeList',required:true,
                        onSelect: function(rec){  
                            $('#DictionaryParentID').val(rec.id); }" />
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Sort)</td>
                <td>
                    <input class="easyui-numberbox" id="Sort" name="Sort" data-options="precision:0,groupSeparator:' ',decimalSeparator:','" />
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.IsSystem)</td>
                <td>
                    <input type="hidden" id="IsSystem" name="IsSystem" />
                    <select id="IsSystem1" name="IsSystem1" class="easyui-combobox" data-options="panelHeight:'auto',
                        onSelect: function(rec){  
                        var data = $('#IsSystem1').combobox('getValue');
                        if (data == 0) {
                             $('#IsSystem').val(true);
                            } else {
                                $('#IsSystem').val(false);
                            } }">
                        <option value="0" selected="selected">系统字典</option>
                        <option value="1">非系统字典</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Remark)</td>
                <td>
                    @Html.TextAreaFor(m => m.Remark, new { @style = "width:100%", @rows = "10", @class = "easyui-validatebox" })
                </td>
            </tr>
        </table>

    </form>
</div>
<div id="dlg-buttons">
    <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="save()">保存</a>
    <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
</div>
